#include<bits/stdc++.h>

using namespace std;
using ll=long long;
const int n = 100;

ll h(ll x) {
    return x * x * x * x * x;
}

/**
 * @return
 */
int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    // 记录开始时间
    auto start = chrono::steady_clock::now();

    ll a, b, c, d, e, f;
    for (a = 1; a <= n; a++)
        for (b = a; b <= n; b++)
            for (c = b; c <= n; c++)
                for (d = c; d <= n; d++)
                    for (e = d; e <= n; e++)
                        for (f = e + 1; f <= n; f++) {
                            if (h(f) == h(e) + h(d) + h(c) + h(b) + h(a)) {
                                cout << a << " " << b << " " << c << " " << d << " " << e << " " << f << endl;
                            }
                        }
    // 记录结束时间
    auto end = chrono::steady_clock::now();

    // 输出程序运行结果和时间
    cerr << chrono::duration<double, milli>(end - start).count() << " ms" << endl;// 19453.2 ms

    return 0;
}